package cn.tank.service;

import cn.tank.pojo.Article;
import cn.tank.repository.ArticleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: ZLY
 * @Date: 2020/11/7 17:44
 * @Description:
 */
@Service
public class ArticleService {

    @Autowired
    private ArticleRepository articleRepository;

    public List<Article> findALl(){
        return articleRepository.findAll();
    }

    public Page<Article> findALl(Pageable pageable){
        return articleRepository.findAll(pageable);
    }
}
